#include <stdio.h>
 
int main() {
     char s[201];
     scanf("%[^\n]",s);
     int i=0;
     int x=0,y=0,z=0,q=0;
     while(s[i]!='\0'){
             if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
            ++x;
         else if(s[i]>='0'&&s[i]<='9')
             ++y;
         else if(s[i]==' ')
             ++z;
         else
             ++q;
         ++i;
     }
     printf("%d %d %d %d",x,y,z,q);
     return 0;
 }
